package top.aigoo.project01.enums;

/**
 * Created by  Mr.OYSHUO.欧阳大叔(1642302522@qq.com) on 2021/8/25
 */
public enum ProductCategoryEnum {
    SUCCESS(1, "操作成功"),
    INNER_ERROR(-1000,"内部错误"),
    NULL_SHOPID(-1002, "ShopId为空!");

    private int state;

    private String stateInfo;

    private ProductCategoryEnum(int state, String stateInfo) {
        this.state = state;
        this.stateInfo = stateInfo;
    }

    public static ProductCategoryEnum stateOf(int state) {
        for (ProductCategoryEnum productCategoryEnum : values()) {
            if (productCategoryEnum.getState() == state) {
                return productCategoryEnum;
            }
        }
        return null;
    }

    public int getState() {
        return this.state;
    }

    public String getStateInfo() {
        return stateInfo;
    }
}
